//import kotlinx.cinterop.*
//import platform.posix.pthread_self
//import kotlin.concurrent.AtomicInt
//import kotlin.native.concurrent.TransferMode
//import kotlin.native.concurrent.Worker
//import kotlin.native.concurrent.freeze
//import kotlinx.coroutines.*
//
//@OptIn(ExperimentalForeignApi::class)
//fun main() {
//    val worker = Worker.start(true, "worker1")
//    println("Position 1, thread id: ${pthread_self()}")
//    val future = worker.execute(TransferMode.SAFE, {
//        println("Position 2, thread id: ${pthread_self()}")
//        1 + 2
//    }) {
//        println("Position 3, thread id: ${pthread_self()}")
//        (it + 100).toString()
//    }
//    future.consume {
//        println("Position 4, thread id: ：${pthread_self()}")
//        println("Result: $it")
//    }
//}
